//
//  WNBaseModel.m
//  iOSOCProjectDirectory
//
//  Created by BHmac on 2017/6/8.
//  Copyright © 2017年 XieXuan. All rights reserved.
//

#import "WNBaseModel.h"

@implementation WNBaseModel

- (NSMutableArray *)departModelWithArr:(NSArray *)arr{
    
    NSMutableArray *dataArr = [NSMutableArray new];
    
    for (NSDictionary *dict in arr) {
        WNBaseModel *model = [[WNBaseModel alloc]init];
        [model setValuesForKeysWithDictionary:dict];
        [dataArr addObject:model];
    }
    return dataArr;
}


- (void)setValue:(id)value forKey:(NSString *)key{
    if ([value isKindOfClass:[NSNumber class]]) {
        [self setValue:[NSString stringWithFormat:@"%@",value] forKey:key];
    }else if ([value isKindOfClass:[NSNull class]]) {
        [self setValue:[NSString stringWithFormat:@"%@",value] forKey:key];
    }else if(value == nil){
        [self setValue:[NSString stringWithFormat:@" "] forKey:key];
    }else{
        [super setValue:value forKey:key];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

@end
